package com.tanhua.server.controller;

import com.tanhua.server.service.TestSoulService;
import com.tanhua.server.vo.QuestionnaireVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/testSoul")
@RestController
public class TestSoulController {
    @Autowired
    TestSoulService testSoulService;

    @GetMapping
public ResponseEntity questionnaireList(){

        try {
            List<QuestionnaireVo> questionnaireVoList = testSoulService.queryQuestionnaire();
            return ResponseEntity.ok(questionnaireVoList );
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();



    }

}
